lastNotNull

fun <T : Any> Array<out T>.lastNotNull(): T(source)
fun <T : Any> List<T>.lastNotNull(): T(source)

Returns the last non-null element or throws NoSuchElementException otherwise.